﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using BluSteamClient.ViewModel;

namespace BluSteamClient.View
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {

        public MainWindow()
        {
            InitializeComponent();
            WindowResizer wr = new WindowResizer(this);
            wr.addResizerDown(BottomBorder);
            wr.addResizerRight(RightBorder);
        }

        private void CloseWindow_Click(object sender, RoutedEventArgs e)
        {
            MainWindowViewModel.Logout();
            this.Close();
        }

        private void MinimiseWindow_Click(object sender, RoutedEventArgs e)
        {
            this.WindowState = WindowState.Minimized;
        }

        private void MaximiseWindow_Click(object sender, RoutedEventArgs e)
        {
            this.WindowState = WindowState.Maximized;
            Button MaximiseButton = (Button)sender;
            MaximiseButton.Content = "O";
            MaximiseButton.Click +=new RoutedEventHandler(NormaliseWindow_Click);
        }

        private void NormaliseWindow_Click(object sender, RoutedEventArgs e)
        {
            this.WindowState = WindowState.Normal;
            Button MaximiseButton = (Button)sender;
            MaximiseButton.Content = "O";
            MaximiseButton.Click += new RoutedEventHandler(MaximiseWindow_Click);
        }

        private void DragWindow(object sender, MouseButtonEventArgs e)
        {
            DragMove();
        }



        
              
    }
}
